package com.slipper.system.log;

import javax.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.slipper.system.api.log.bo.OperatorLogBO;
import com.slipper.system.api.log.service.IOperatorLogSv;
import com.slipper.common.util.ResultUtil;

/**
 * 操作日志表
 * 
 * @date 2020-07-10 20:33:39
 */
@RestController
@RequestMapping("/operatorLog")
public class OperatorLogController {
    @Resource
    private IOperatorLogSv operatorLogSv;
    
    @PostMapping(value = "/queryBy")
    public String queryBy(@RequestBody OperatorLogBO bo) {
        if(bo.getId() == null || "".equals(bo.getId())) {
            return ResultUtil.toErrorJson("数据获取失败！");
        }
        return ResultUtil.toJson(operatorLogSv.queryBy(bo.getId()));
    }
    
    @PostMapping(value = "/queryPage")
    public String queryPage(@RequestBody OperatorLogBO bo) {
        return ResultUtil.toJson(operatorLogSv.queryPage(bo));
    }

    @PostMapping(value = "/save")
    public String save(@RequestBody OperatorLogBO bo) {
        return ResultUtil.toJson(operatorLogSv.save(bo));
    }

    @PostMapping(value = "/delete")
    public String delete(@RequestBody OperatorLogBO bo) {
        return ResultUtil.toJson(operatorLogSv.delete(bo));
    }
}
